g_assert (appearance != NULL);
context = gtk_widget_get_style_context (text_renderer->widget);
- state = gtk_widget_get_state_flags (text_renderer->widget);
+ state = gtk_style_context_get_state (context);
if (appearance->draw_bg && text_renderer->state == NORMAL)
bg_rgba = appearance->rgba[0];
if (text_renderer->state == SELECTED)
{
+ gtk_style_context_save (context);
+
state |= GTK_STATE_FLAG_SELECTED;
+ gtk_style_context_set_state (context, state);
gtk_style_context_get (context, state, "color", &fg_rgba, NULL);
+
+ gtk_style_context_restore (context);
}
else if (text_renderer->state == CURSOR && gtk_widget_has_focus (text_renderer->widget))
{
gtk_style_context_save (context);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_VIEW);
- state = gtk_widget_get_state_flags (widget);
+ state = gtk_style_context_get_state (context);
gtk_style_context_get_color (context, state, &color);
cairo_save (cr);
{
GdkRGBA color;
- state = gtk_widget_get_state_flags (text_renderer->widget);
+ state = gtk_style_context_get_state (context);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_style_context_get_background_color (context, state, &color);
G_GNUC_END_IGNORE_DEPRECATIONS